<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreatePaymentLog extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create(
            'payment_log',
            function (Blueprint $table) {
                $table->bigIncrements('id');
                $table->unsignedInteger('user_id')->default(0)->comment('用户id');
                $table->unsignedInteger('cooperative_id')->default(0)->comment('合作商id');
                $table->unsignedDecimal('money', 10, 2)->default(0.00)->comment('金额');
                $table->unsignedTinyInteger('is_self_merchant')->default(0)->comment('是否自有商户号打款 0:否 1:是');
                $table->timestamps();
            }
        );
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('payment_log');
    }
}
